let alertOptions = {
  animation: 'zoom',
  confirmButtonClass: 'btn-primary',
  keyboardEnabled: true
}

export function alert(title, content, callback) {
  let options = Object.assign(alertOptions, {
    title: title,
    content: content,
    theme: 'dark',
    buttons: {
      ok: {
        text: '确定',
        btnClass: 'btn waves-effect waves-light btn-block btn-primary',
        action: callback
      }
    }
  })
  $.alert(options)
}

export function confirm(title, content, callback) {
  let options = Object.assign(alertOptions, {
    title: title,
    content: content,
    confirm: callback,
    theme: 'dark',
    closeAnimation: 'scale',
    closeAnimation: 'scale',
    buttons: {
      confirm: {
        text: '确定',
        keys: ['y'],
        btnClass: 'btn waves-effect waves-light btn-primary btn-sm',
        action: function () {
          callback()
        }
      },
      cancel: {
        text: '取消',
        keys: ['N'],
        btnClass: 'btn waves-effect waves-light btn-info btn-sm',
      },
    }
  })
  $.confirm(options)
}
